package com.dchh.android.suverynew.http;

/**
 * Created by 秋云 on 2014/10/24.
 */
public enum ResponseStateEnum {
    UnkownError(-1),//
    Success(0),//请求正确返回
    TokenExpired(-100039),// token 过期
    LoginTokenExpired(-100058),//login token过期
    NoNeedUpdate(-100123),//login token过期
    ;

    private int code;

    ResponseStateEnum(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static ResponseStateEnum fromCode(int code) {
        for (ResponseStateEnum responseMode : values()) {
            if (responseMode.getCode() == code) {
                return responseMode;
            }
        }
        return UnkownError;
    }
}
